home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
pibt40s1.arc
/
EXECPC.MOD
< prev
next >
Wrap
Text File
|
1987-05-22
|
4KB
|
101 lines
(*----------------------------------------------------------------------*)
(* Exec_PC_Commands --- Process EXEC PC BBS commands *)
(*----------------------------------------------------------------------*)
PROCEDURE Exec_PC_Commands;
(*----------------------------------------------------------------------*)
(* *)
(* Procedure: Exec_PC_Commands *)
(* *)
(* Purpose: Process Exec PC BBS special escape code commands *)
(* *)
(* Calling Sequence: *)
(* *)
(* Exec_PC_Commands; *)
(* *)
(* Calls: *)
(* *)
(* Async_Send *)
(* Async_Receive *)
(* PibDownLoad *)
(* *)
(*----------------------------------------------------------------------*)
VAR
X: INTEGER;
Y: INTEGER;
Ch: CHAR;
C: INTEGER;
L: INTEGER;
BEGIN (* Exec_PC_Commands *)
(* Get next character after Exec PC flag *)
Async_Receive_With_TimeOut( 5 , C );
IF C <> TimeOut THEN
Ch := CHR( C )
ELSE
Ch := CHR( 0 );
(* Handle it *)
CASE Ch OF
'D' : BEGIN (* Auto-Download *)
FileName[0] := #0;
L := 0;
WRITE('Autodownloading ');
REPEAT
Async_Receive_With_TimeOut( 5 , C );
IF C <> TimeOut THEN
Ch := CHR( C )
ELSE
Ch := CHR( 0 );
IF NOT ( ORD( Ch ) IN [ACK,CAN,NUL] ) THEN
BEGIN
Async_Send( Ch ); (* echo 1 char at a time *)
L := SUCC( L );
FileName[L] := Ch;
WRITE( Ch );
END;
UNTIL ORD(Ch) IN [ACK,CAN];
FileName[0] := CHR( L );
IF ORD( Ch ) = ACK THEN
BEGIN (* Filename echoed correctly *)
FOR X := 0 TO 18 DO
WRITELN;
IF POS( '=X' , FileName ) <> 0 THEN
DELETE( FileName , POS( '=X' , FileName ) , 2 );
FileName := TRIM( FileName );
PibDownload( Xmodem_Chk );
END;
END (* Auto_DownLoad *);
'2' : BEGIN (* Draw a Box at corners (Oldx,Oldy) and (NewX,NewY) *)
Draw_Box( OldX, OldY, NewX, NewY,
Global_Text_Attribute, Menu_Text_Color, '' );
END;
ELSE;
END (* CASE *);
END (* Exec_PC_Commands *);